﻿using System.Collections.Generic;
using System.Linq;
using Citi.PTSConsolidation.Domain;

namespace Citi.PTSConsolidation.WebUi.Models
{
    public class ProgramModel
    {
        public string Id { get; set; }
        public string ProgramName { get; set; }
        public string ProgramInvestmentAlignmentCategory { get; set; }
        public string KeyBusinessContact { get; set; }
        public string TechnologyProgramManager { get; set; }
        public string TechProgramManagerSMT { get; set; }
        public string TechProgramManagerSTLT { get; set; }
        public string ProgramOwner { get; set; }

        public static ProgramModel CreateModel(Program domain)
        {
            return new ProgramModel
            {
                Id = domain.Id,
                KeyBusinessContact = domain.KeyBusinessContact,
                ProgramInvestmentAlignmentCategory = domain.ProgramInvestmentAlignmentCategory,
                ProgramName = domain.ProgramName,
                TechnologyProgramManager = domain.TechnologyProgramManager,
                TechProgramManagerSMT = domain.TechProgramManagerSMT,
                TechProgramManagerSTLT = domain.TechProgramManagerSTLT,
                ProgramOwner = domain.ProgramOwner
            };
        }

        public static IEnumerable<ProgramModel> CreateModel(IEnumerable<Program> domain)
        {
            return domain.Select(CreateModel);
        }
    }
}